<!DOCTYPE HTML>
<html lang="de">
    <head>
        <title>Hyphenator.js &ndash; Test 25</title>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <style type="text/css">
            body {
                width:50%;
                margin-left:25%;
                margin-right:25%;
            }
            #test {
            	background-color: #ffd6d6;
            }
            #ref {
            	background-color: #d6ffd6;
            }
        </style>
    </head>
    <body>
		<p><a href="index.html">&lt;&lt; index</a> | <a href="test24.html">&lt;- Prev</a> | <a href="test26.html">Next -&gt;</a></p>
        <h1>Test 25</h1>
        <p id="desc">Set a proprietary toogle box.</p>
		<p id="hyphenationbutton">toggle hyphenation</p>
        <p id="test" class="hyphenate" lang="en">To allow more efficient usage of paper, more regular appearance of right-side margins without requiring spacing adjustments, and to eliminate the need to erase hand-written long words begun near the end of a line that do not fit, words may be divided at the nearest breakpoint between syllables and a hyphen inserted to indicate that the letters form a word fragment, not a word.</p>
        <p id="ref">To allow more ef|fi|cient usage of paper, more reg|u|lar ap|pear|ance of right-&#8203;side mar|gins with|out re|quir|ing spac|ing ad|just|ments, and to elim|i|nate the need to erase hand-&#8203;writ|ten long words begun near the end of a line that do not fit, words may be di|vid|ed at the near|est break|point be|tween syl|la|bles and a hy|phen in|sert|ed to in|di|cate that the let|ters form a word frag|ment, not a word.</p>
        <p id="ref2">To allow more efficient usage of paper, more regular appearance of right-side margins without requiring spacing adjustments, and to eliminate the need to erase hand-written long words begun near the end of a line that do not fit, words may be divided at the nearest breakpoint between syllables and a hyphen inserted to indicate that the letters form a word fragment, not a word.</p>
        <script src="../Hyphenator.js" type="text/javascript"></script>
        <script type="text/javascript">
        	var myelem = document.getElementById('hyphenationbutton');
        	Hyphenator.customEvents.addEventListener('onhyphenationdone', function () {
        		myelem.style.color = '#00FF00';
        		myelem.style.cursor = 'pointer';
        		myelem.onclick = function () {
        			Hyphenator.removehyphenation();
        		};
        	});
        	Hyphenator.customEvents.addEventListener('onremovehyphenationdone', function () {
        		myelem.style.color = '#FF0000';
        		myelem.onclick = function () {
        			Hyphenator.run();
        		};
        	});
        	
        	if (parent != window) {
				window.setTimeout(function () {
					var t1 = document.getElementById('test').innerHTML,
					t2 = document.getElementById('ref').innerHTML,
					t3 = document.getElementById('ref2').innerHTML,
					desc = document.getElementById('desc').firstChild.data,
					msg = {
						desc: desc,
						index: 25
					}, r = true;
					
					r = (t1 == t2);
					
					myelem.onclick();
					
					r = (t1 == t3);
					
					myelem.onclick();
				
					r = (t1 == t2);
					
					if (r) {
						msg.result = 'passed';
					} else {
						msg.result = 'failed';
					}
					parent.postMessage(JSON.stringify(msg), window.location.href);
				}, 500);     	
			}

			Hyphenator.run({
				wordhyphenchar: '|'
			});
        </script>
    </body>
</html>